/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.thienloc.omap.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author duongnv
 */
@Entity
@SequenceGenerator(name="seq_acc_cp", initialValue=1, allocationSize=1)
@Table(name = "TBL_ACCOUNT_CP", catalog = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "TblAccountCp.findAll", query = "SELECT t FROM TblAccountCp t"),
    @NamedQuery(name = "TblAccountCp.findById", query = "SELECT t FROM TblAccountCp t WHERE t.id = :id"),
    @NamedQuery(name = "TblAccountCp.findByUserId", query = "SELECT t FROM TblAccountCp t WHERE t.userId = :userId"),
    @NamedQuery(name = "TblAccountCp.findByUserPass", query = "SELECT t FROM TblAccountCp t WHERE t.userPass = :userPass"),
    @NamedQuery(name = "TblAccountCp.findByIp", query = "SELECT t FROM TblAccountCp t WHERE t.ip = :ip"),
    @NamedQuery(name = "TblAccountCp.findByCpName", query = "SELECT t FROM TblAccountCp t WHERE t.cpName = :cpName"),
    @NamedQuery(name = "TblAccountCp.findByCpAddress", query = "SELECT t FROM TblAccountCp t WHERE t.cpAddress = :cpAddress"),
    @NamedQuery(name = "TblAccountCp.findByCpPhone", query = "SELECT t FROM TblAccountCp t WHERE t.cpPhone = :cpPhone"),
    @NamedQuery(name = "TblAccountCp.findByStartTime", query = "SELECT t FROM TblAccountCp t WHERE t.startTime = :startTime"),
    @NamedQuery(name = "TblAccountCp.findByEndTime", query = "SELECT t FROM TblAccountCp t WHERE t.endTime = :endTime"),
    @NamedQuery(name = "TblAccountCp.findByIsLocked", query = "SELECT t FROM TblAccountCp t WHERE t.isLocked = :isLocked"),
    @NamedQuery(name = "TblAccountCp.findByNumConcurrentTrans", query = "SELECT t FROM TblAccountCp t WHERE t.numConcurrentTrans = :numConcurrentTrans"),
    @NamedQuery(name = "TblAccountCp.findByRateLevel", query = "SELECT t FROM TblAccountCp t WHERE t.rateLevel = :rateLevel"),
    @NamedQuery(name = "TblAccountCp.findBySpecialBonus", query = "SELECT t FROM TblAccountCp t WHERE t.specialBonus = :specialBonus"),
    @NamedQuery(name = "TblAccountCp.findByLastUpdatedTime", query = "SELECT t FROM TblAccountCp t WHERE t.lastUpdatedTime = :lastUpdatedTime"),
    @NamedQuery(name = "TblAccountCp.findByGen1", query = "SELECT t FROM TblAccountCp t WHERE t.gen1 = :gen1"),
    @NamedQuery(name = "TblAccountCp.findByGen2", query = "SELECT t FROM TblAccountCp t WHERE t.gen2 = :gen2"),
    @NamedQuery(name = "TblAccountCp.findByGen3", query = "SELECT t FROM TblAccountCp t WHERE t.gen3 = :gen3")})
public class TblAccountCp implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="seq_acc_cp")
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID")
    private BigDecimal id;
    @Size(max = 22)
    @Column(name = "USER_ID")
    private String userId;
    @Size(max = 22)
    @Column(name = "USER_PASS")
    private String userPass;
    @Size(max = 32)
    @Column(name = "IP")
    private String ip;
    @Size(max = 100)
    @Column(name = "CP_NAME")
    private String cpName;
    @Size(max = 200)
    @Column(name = "CP_ADDRESS")
    private String cpAddress;
    @Size(max = 22)
    @Column(name = "CP_PHONE")
    private String cpPhone;
    @Column(name = "START_TIME")
    @Temporal(TemporalType.TIMESTAMP)
    private Date startTime;
    @Column(name = "END_TIME")
    @Temporal(TemporalType.TIMESTAMP)
    private Date endTime;
    @Column(name = "IS_LOCKED")
    private Integer isLocked;
    @Column(name = "NUM_CONCURRENT_TRANS")
    private Integer numConcurrentTrans;
    @Column(name = "RATE_LEVEL")
    private Integer rateLevel;
    @Column(name = "SPECIAL_BONUS")
    private Double specialBonus;
    @Column(name = "LAST_UPDATED_TIME")
    @Temporal(TemporalType.TIMESTAMP)
    private Date lastUpdatedTime;
    @Size(max = 100)
    @Column(name = "GEN1")
    private String gen1;
    @Size(max = 200)
    @Column(name = "GEN2")
    private String gen2;
    @Size(max = 400)
    @Column(name = "GEN3")
    private String gen3;

    public TblAccountCp() {
    }

    public TblAccountCp(BigDecimal id) {
        this.id = id;
    }

    public BigDecimal getId() {
        return id;
    }

    public void setId(BigDecimal id) {
        this.id = id;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getUserPass() {
        return userPass;
    }

    public void setUserPass(String userPass) {
        this.userPass = userPass;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getCpName() {
        return cpName;
    }

    public void setCpName(String cpName) {
        this.cpName = cpName;
    }

    public String getCpAddress() {
        return cpAddress;
    }

    public void setCpAddress(String cpAddress) {
        this.cpAddress = cpAddress;
    }

    public String getCpPhone() {
        return cpPhone;
    }

    public void setCpPhone(String cpPhone) {
        this.cpPhone = cpPhone;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public Integer getIsLocked() {
        return isLocked;
    }

    public void setIsLocked(Integer isLocked) {
        this.isLocked = isLocked;
    }

    public Integer getNumConcurrentTrans() {
        return numConcurrentTrans;
    }

    public void setNumConcurrentTrans(Integer numConcurrentTrans) {
        this.numConcurrentTrans = numConcurrentTrans;
    }

    public Integer getRateLevel() {
        return rateLevel;
    }

    public void setRateLevel(Integer rateLevel) {
        this.rateLevel = rateLevel;
    }

    public Double getSpecialBonus() {
        return specialBonus;
    }

    public void setSpecialBonus(Double specialBonus) {
        this.specialBonus = specialBonus;
    }

    public Date getLastUpdatedTime() {
        return lastUpdatedTime;
    }

    public void setLastUpdatedTime(Date lastUpdatedTime) {
        this.lastUpdatedTime = lastUpdatedTime;
    }

    public String getGen1() {
        return gen1;
    }

    public void setGen1(String gen1) {
        this.gen1 = gen1;
    }

    public String getGen2() {
        return gen2;
    }

    public void setGen2(String gen2) {
        this.gen2 = gen2;
    }

    public String getGen3() {
        return gen3;
    }

    public void setGen3(String gen3) {
        this.gen3 = gen3;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TblAccountCp)) {
            return false;
        }
        TblAccountCp other = (TblAccountCp) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.thienloc.omap.entity.TblAccountCp[ id=" + id + " ]";
    }
    
}
